home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
dev
/
misc
/
egs.lha
/
EGS
/
EGS_Devels
/
Examples
/
ASM
/
window.asm
< prev
next >
Wrap
Assembly Source File
|
1993-02-17
|
5KB
|
233 lines
*
* window.asm -- Asm example that calls the EGS functions
*
* Assemble with SASC assembler
*
* $
* $ FILE : window.asm
* $ VERSION : 1
* $ REVISION : 20
* $ DATE : 08-Feb-93 23:04
* $
* $ Author : mvk
* $
*
* This program is intended to open a EI_Window with
* a rectangle in it.
* It's only purpose is to show that the ASM includes work
*
*
* (c) Copyright 1990/93 VIONA Development
* All Rights Reserved
*
*
INCLUDE "exec/types.i"
INCLUDE "exec/macros.i"
INCLUDE "exec/libraries.i"
INCLUDE "exec/nodes.i"
INCLUDE "exec/ports.i"
INCLUDE "egs/all.i"
XDEF _main
XREF _printf
XREF _AbsExecBase
EXTERN_LIB OpenLibrary
EXTERN_LIB CloseLibrary
EXTERN_LIB GetMsg
EXTERN_LIB WaitPort
EXTERN_LIB ReplyMsg
STRUCTURE my_libs,0
APTR my_egsgfx
APTR my_egsintui
APTR my_win
APTR my_rast
APTR my_port
APTR my_msg
LABEL my_SIZE
section code
_main:
;------ open the test library: this will load it from disk
move.l _AbsExecBase,a6
lea -my_SIZE(a7),a7 ;Sturcture Memory
move.l a7,a5
move.l a7,myptr
lea egsintuiName(pc),a1
moveq #0,d0
CALLLIB _LVOOpenLibrary
move.l d0,my_egsintui(a5)
tst.l d0
bne.s 1$
;------ couldn't find the library
pea egsintuiName(pc)
pea nolibmsg(pc)
jsr _printf
addq #8,sp
bra main_end
1$:
lea egsgfxName(pc),a1
moveq #0,d0
CALLLIB _LVOOpenLibrary
move.l d0,my_egsgfx(a5)
tst.l d0
bne.s 2$
;------ couldn't find the library
pea egsgfxName(pc)
pea nolibmsg(pc)
jsr _printf
addq #8,sp
bra main_end1
2$:
pea egsintuiName(pc)
pea Msg1(pc)
jsr _printf
addq #8,sp ;fix 2 long stack pushes
pea egsgfxName(pc)
pea Msg1(pc)
jsr _printf
addq #8,sp ;fix 2 long stack pushes
;------ print the library name, version, and revision
moveq #0,d0
pea Msg2(pc)
jsr _printf
addq #4,sp ;fix 1 long stack pushes
;------ call the first test function
lea mywin,a0
LINKLIB _LVOEI_OpenWindow,my_egsintui(a5)
tst.l d0
bne 3$
pea Msg4(pc)
jsr _printf
addq #4,sp ;fix 1 long stack pushes
bra ende
3$:
move.l d0,my_win(a5)
move.l d0,a0
move.l eiwi_UserPort(a0),my_port(a5)
move.l eiwi_RPort(a0),my_rast(a5)
move.l my_rast(a5),a0
move.l #$FF000000,d0 ;red
LINKLIB _LVOEG_SetAPen,my_egsgfx(a5)
move.l my_rast(a5),a0
move.w #50,d0
move.w #50,d1
move.w #100,d2
move.w #100,d3
moveq #0,d5
LINKLIB _LVOEG_RectFill,my_egsgfx(a5)
loop:
move.l my_port(a5),a0
CALLLIB _LVOWaitPort
move.l my_port(a5),a0
CALLLIB _LVOGetMsg
move.l d0,my_msg(a5)
move.l d0,a1
CALLLIB _LVOReplyMsg
move.l my_msg(a5),a1
move.l eims_Class(a1),d0
cmp.l #EI_iCLOSEWINDOW,d0
bne loop
pea Msg5(pc)
jsr _printf
addq #4,sp ;fix 1 long stack pushes
move.l myptr,a5
move.l my_win(a5),a0
LINKLIB _LVOEI_CloseWindow,my_egsintui(a5)
ende:
move.l myptr,a5
;------ close the egsgfx.library
move.l _AbsExecBase,a6
move.l my_egsgfx(a5),a1
CALLLIB _LVOCloseLibrary
main_end:
move.l myptr,a5
;------ close the egsintui.library
move.l _AbsExecBase,a6
move.l my_egsintui(a5),a1
CALLLIB _LVOCloseLibrary
main_end1:
lea my_SIZE(a7),a7
moveq #0,d0
rts
myptr: dc.l 0
mywin: dc.w 100
dc.w 100
dc.w 350
dc.w 350
dc.w 200
dc.w 200
dc.w 3000
dc.w 3000
dc.l 0
dc.l EI_WINDOWSIZE!EI_WINDOWCLOSE!EI_WINDOWBACK!EI_WINDOWDRAG
dc.l 0
dc.l name
dc.l 0
dc.l EI_iCLOSEWINDOW
dc.l 0
color:
dc.l 0 ;1
dc.l 0 ;2
dc.l 0 ;3
dc.l 0 ;4
dc.l 0 ;5
dc.l 0 ;6
dc.l 0 ;8
dc.l 0 ;Menu
dc.l 0 ; Render
name: dc.b 'Winddow',0
egsgfxName: dc.b 'egsgfx.library',0
egsintuiName: dc.b 'egsintui.library',0
nolibmsg: dc.b 'Can not open library "%s"',10,0
Msg1: dc.b 'Open library "%s"',10,0
Msg2: dc.b 'Call EI_OpenWindw',10,0
Msg4: dc.b 'Cant Open Window',10,0
Msg5: dc.b 'Call EI_CloseWindow',10,0
cnop 4,0
END